-- MySQL dump 10.13  Distrib 8.0.28, for macos11 (x86_64)
--
-- Host: localhost    Database: apulti
-- ------------------------------------------------------
-- Server version	8.0.28

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `device`
--

DROP TABLE IF EXISTS `device`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `device` (
  `iddevice` int unsigned NOT NULL AUTO_INCREMENT,
  `device_name` varchar(100) NOT NULL,
  `device_socketConn` int NOT NULL DEFAULT '-1',
  `device_sudNum` int NOT NULL DEFAULT '0',
  `device_courtNum` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`iddevice`),
  UNIQUE KEY `device_name_UNIQUE` (`device_name`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `device`
--

LOCK TABLES `device` WRITE;
/*!40000 ALTER TABLE `device` DISABLE KEYS */;
INSERT INTO `device` VALUES (1,'eab7baf1364c07ff',-1,0,0),(2,'9a06a317917ecf06',-1,0,0),(3,'9c7c7ecf4afe05d0',-1,0,0),(4,'84aa08e35975b651',-1,0,0),(5,'76585bf7e5ec6022',-1,0,0),(6,'59169c6bedffd029',-1,0,0),(7,'868ee3f8f36200b7',-1,0,0),(8,'9d261795905d0813',-1,0,0),(9,'37dafcfb6cea9054',-1,0,0),(10,'66486fb854c8ea8d',-1,0,0),(11,'0238719b854d',-1,0,0),(12,'17ad6516d5bf',-1,0,0),(13,'a04cc72296c1',-1,0,0),(14,'9c42c819d0af',-1,0,0),(15,'d342b764929d',-1,0,0),(16,'6dfbfa090a13',-1,0,0),(17,'6e35f46b39c0',-1,0,0),(18,'1593b97f4622',-1,0,0),(19,'13f76d945709',-1,0,0),(20,'cdf400fdbb3f',-1,0,0),(21,'30e9d9015f8c',-1,0,0),(22,'c4faae239f9b5170',-1,0,0),(23,'5409210ec3c7',-1,0,0),(24,'12a8e0c5a0051c1c',28,2,1),(25,'60100ddb8353efe7',-1,0,0),(26,'64ad59df50228762',27,1,1),(27,'29eac5022fddba79',13,3,1),(28,'d87eb027aff1ff1a',-1,0,0);
/*!40000 ALTER TABLE `device` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ocenki`
--

DROP TABLE IF EXISTS `ocenki`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ocenki` (
  `vistuplenie_idvistuplenie` int unsigned NOT NULL,
  `ocenki_nomsud` tinyint unsigned NOT NULL,
  `sudi_idsudi` int unsigned DEFAULT NULL,
  `ocenki_t` tinyint unsigned NOT NULL,
  `ocenki_p` tinyint unsigned NOT NULL,
  PRIMARY KEY (`vistuplenie_idvistuplenie`,`ocenki_nomsud`),
  KEY `fk_ocenki_vistuplenie1_idx` (`vistuplenie_idvistuplenie`),
  KEY `fk_ocenki_sudi1_idx` (`sudi_idsudi`),
  CONSTRAINT `fk_ocenki_sudi1` FOREIGN KEY (`sudi_idsudi`) REFERENCES `sudi` (`idsudi`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_ocenki_vistuplenie1` FOREIGN KEY (`vistuplenie_idvistuplenie`) REFERENCES `vistuplenie` (`idvistuplenie`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ocenki`
--

LOCK TABLES `ocenki` WRITE;
/*!40000 ALTER TABLE `ocenki` DISABLE KEYS */;
/*!40000 ALTER TABLE `ocenki` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `phumse`
--

DROP TABLE IF EXISTS `phumse`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `phumse` (
  `idphumse` int unsigned NOT NULL,
  `phumse_name` varchar(45) NOT NULL,
  PRIMARY KEY (`idphumse`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `phumse`
--

LOCK TABLES `phumse` WRITE;
/*!40000 ALTER TABLE `phumse` DISABLE KEYS */;
INSERT INTO `phumse` VALUES (0,'Taegeuk 1'),(1,'Taegeuk 2'),(2,'Taegeuk 3'),(3,'Taegeuk 4'),(4,'Taegeuk 5'),(5,'Taegeuk 6'),(6,'Taegeuk 7'),(7,'Taegeuk 8'),(8,'Koryo'),(9,'Keumgang'),(10,'Taeback'),(11,'Pyonwon'),(12,'Sipjin'),(13,'Jitae'),(14,'Chonkwon'),(15,'Hansu'),(16,'Freestyle');
/*!40000 ALTER TABLE `phumse` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `rang`
--

DROP TABLE IF EXISTS `rang`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `rang` (
  `vistuplenie_idvistuplenie` int unsigned NOT NULL,
  `rang_tot1` int NOT NULL,
  `rang_tot2` int NOT NULL,
  `rang_tot` int NOT NULL,
  `rang_vistplenie_pred` int NOT NULL,
  `rang_sumteh` int NOT NULL,
  `rang_sumpres` int NOT NULL,
  `rang_sumobsh` int NOT NULL,
  `rang_category` varchar(200) DEFAULT NULL,
  `rang_nomer_category` int NOT NULL DEFAULT '0',
  `rang_athlethe_nomer` int NOT NULL,
  `rang_athlethe` varchar(200) DEFAULT NULL,
  `rang_tekKrug` int NOT NULL,
  PRIMARY KEY (`vistuplenie_idvistuplenie`),
  KEY `fk_vistuplenie_has_rang_vistuplenie1_idx` (`vistuplenie_idvistuplenie`),
  CONSTRAINT `fk_vistuplenie_has_rang_vistuplenie1_idx` FOREIGN KEY (`vistuplenie_idvistuplenie`) REFERENCES `vistuplenie` (`idvistuplenie`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `rang`
--

LOCK TABLES `rang` WRITE;
/*!40000 ALTER TABLE `rang` DISABLE KEYS */;
/*!40000 ALTER TABLE `rang` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `settings`
--

DROP TABLE IF EXISTS `settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `settings` (
  `idsettings` int unsigned NOT NULL AUTO_INCREMENT,
  `settings_kort` int NOT NULL,
  `settings_sys` int NOT NULL,
  `settings_count_judges` int NOT NULL,
  PRIMARY KEY (`idsettings`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `settings`
--

LOCK TABLES `settings` WRITE;
/*!40000 ALTER TABLE `settings` DISABLE KEYS */;
INSERT INTO `settings` VALUES (1,1,1,5);
/*!40000 ALTER TABLE `settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sudgotov`
--

DROP TABLE IF EXISTS `sudgotov`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sudgotov` (
  `vistuplenie_idvistuplenie` int unsigned NOT NULL,
  `nomersud` tinyint NOT NULL,
  PRIMARY KEY (`vistuplenie_idvistuplenie`,`nomersud`),
  KEY `fk_vistuplenie_has_sudi_vistuplenie1_idx` (`vistuplenie_idvistuplenie`),
  CONSTRAINT `fk_vistuplenie_has_sudi_vistuplenie1` FOREIGN KEY (`vistuplenie_idvistuplenie`) REFERENCES `vistuplenie` (`idvistuplenie`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sudgotov`
--

LOCK TABLES `sudgotov` WRITE;
/*!40000 ALTER TABLE `sudgotov` DISABLE KEYS */;
/*!40000 ALTER TABLE `sudgotov` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sudi`
--

DROP TABLE IF EXISTS `sudi`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sudi` (
  `idsudi` int unsigned NOT NULL AUTO_INCREMENT,
  `sudi_fio` varchar(45) NOT NULL,
  `sudi_karta` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`idsudi`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sudi`
--

LOCK TABLES `sudi` WRITE;
/*!40000 ALTER TABLE `sudi` DISABLE KEYS */;
/*!40000 ALTER TABLE `sudi` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `vistuplenie`
--

DROP TABLE IF EXISTS `vistuplenie`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `vistuplenie` (
  `idvistuplenie` int unsigned NOT NULL AUTO_INCREMENT,
  `vistuplenie_nomer` smallint NOT NULL,
  `vistuplenie_pokaz` tinyint NOT NULL DEFAULT '1',
  `vistuplenie_activno` tinyint(1) NOT NULL DEFAULT '0',
  `vistuplenie_zaversheno` tinyint(1) NOT NULL DEFAULT '0',
  `vistuplenie_sportsmen` varchar(200) DEFAULT NULL,
  `phumse_idphumse` int unsigned NOT NULL,
  `vistuplenie_kategoria` varchar(100) DEFAULT NULL,
  `vistuplenie_pred` int unsigned DEFAULT NULL,
  `vistuplenie_sort` int DEFAULT '0',
  `vistuplenie_idvistup` int unsigned DEFAULT NULL,
  `vistuplenie_idkategori` int unsigned DEFAULT NULL,
  `vistuplenie_krugNomer` tinyint DEFAULT NULL,
  `vistuplenie_idsorevn` int unsigned DEFAULT NULL,
  PRIMARY KEY (`idvistuplenie`),
  KEY `fk_vistuplenie_phumse_idx` (`phumse_idphumse`),
  CONSTRAINT `fk_vistuplenie_phumse` FOREIGN KEY (`phumse_idphumse`) REFERENCES `phumse` (`idphumse`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=696 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `vistuplenie`
--

LOCK TABLES `vistuplenie` WRITE;
/*!40000 ALTER TABLE `vistuplenie` DISABLE KEYS */;
/*!40000 ALTER TABLE `vistuplenie` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2023-07-24 12:17:56
